package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class SystemMenu {
    public static final int START_MENU = 1; // 启用
    public static final int CLOSE_MENU = 0; // 禁用

    public static final int CATALOGUE = 0; // 目录
    public static final int MENU = 1; // 菜单

    public String getStatusDisplay() {
        switch (status) {
            case START_MENU : return "启用";
            case CLOSE_MENU : return "禁用";
            default:return "未知";
        }
    }

    public String getMenuDisplay() {
        switch (menuType) {
            case CATALOGUE : return "目录";
            case MENU : return "菜单";
            default:return "未知";
        }
    }

    /** id*/
    private Long id;
    /** 名称*/
    private String name;
    /** 编号*/
    private String sn;
    /** 上级id*/
    private Long parentId;
    /** 上级名称*/
    private String parentName;
    /** 菜单路径*/
    private String menuUrl;
    /** 权限表达式*/
    private String expression;
    /** 排序*/
    private Integer sort;
    /** 状态*/
    private int status;
    // 菜单类型
    private int menuType;
    // 菜单图标
    private String menuIco;

    public String toJson() {
        return JSON.toJSONString(this);
    }
}